Optimal. Leaf size=261 \[ -\frac {b^2 \left (b^2 (3+n)-a^2 (17+5 n)\right ) (d \tan (e+f x))^{1+n}}{d f (1+n) (3+n)}+\frac {\left (a^4-6 a^2 b^2+b^4\right ) \, _2F_1\left (1,\frac {1+n}{2};\frac {3+n}{2};-\tan ^2(e+f x)\right ) (d \tan (e+f x))^{1+n}}{d f (1+n)}+\frac {2 a b^3 (4+n) \tan (e+f x) (d \tan (e+f x))^{1+n}}{d f (2+n) (3+n)}+\frac {4 a b \left (a^2-b^2\right ) \, _2F_1\left (1,\frac {2+n}{2};\frac {4+n}{2};-\tan ^2(e+f x)\right ) (d \tan (e+f x))^{2+n}}{d^2 f (2+n)}+\frac {b^2 (d \tan (e+f x))^{1+n} (a+b \tan (e+f x))^2}{d f (3+n)} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.45, antiderivative size = 261, normalized size of antiderivative = 1.00, number of steps
used = 8, number of rules used = 6, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.261, Rules used = {3647, 3718,
3711, 3619, 3557, 371} \begin {gather*} \frac {4 a b \left (a^2-b^2\right ) (d \tan (e+f x))^{n+2} \, _2F_1\left (1,\frac {n+2}{2};\frac {n+4}{2};-\tan ^2(e+f x)\right )}{d^2 f (n+2)}-\frac {b^2 \left (b^2 (n+3)-a^2 (5 n+17)\right ) (d \tan (e+f x))^{n+1}}{d f (n+1) (n+3)}+\frac {\left (a^4-6 a^2 b^2+b^4\right ) (d \tan (e+f x))^{n+1} \, _2F_1\left (1,\frac {n+1}{2};\frac {n+3}{2};-\tan ^2(e+f x)\right )}{d f (n+1)}+\frac {2 a b^3 (n+4) \tan (e+f x) (d \tan (e+f x))^{n+1}}{d f (n+2) (n+3)}+\frac {b^2 (a+b \tan (e+f x))^2 (d \tan (e+f x))^{n+1}}{d f (n+3)} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 371
Rule 3557
Rule 3619
Rule 3647
Rule 3711
Rule 3718
Rubi steps
\begin {align*} \int (d \tan (e+f x))^n (a+b \tan (e+f x))^4 \, dx &=\frac {b^2 (d \tan (e+f x))^{1+n} (a+b \tan (e+f x))^2}{d f (3+n)}+\frac {\int (d \tan (e+f x))^n (a+b \tan (e+f x)) \left (-a d \left (b^2 (1+n)-a^2 (3+n)\right )+b \left (3 a^2-b^2\right ) d (3+n) \tan (e+f x)+2 a b^2 d (4+n) \tan ^2(e+f x)\right ) \, dx}{d (3+n)}\\ &=\frac {2 a b^3 (4+n) \tan (e+f x) (d \tan (e+f x))^{1+n}}{d f (2+n) (3+n)}+\frac {b^2 (d \tan (e+f x))^{1+n} (a+b \tan (e+f x))^2}{d f (3+n)}-\frac {\int (d \tan (e+f x))^n \left (a^2 d^2 (2+n) \left (b^2 (1+n)-a^2 (3+n)\right )-4 a b \left (a^2-b^2\right ) d^2 (2+n) (3+n) \tan (e+f x)+b^2 d^2 (2+n) \left (b^2 (3+n)-a^2 (17+5 n)\right ) \tan ^2(e+f x)\right ) \, dx}{d^2 (2+n) (3+n)}\\ &=-\frac {b^2 \left (b^2 (3+n)-a^2 (17+5 n)\right ) (d \tan (e+f x))^{1+n}}{d f (1+n) (3+n)}+\frac {2 a b^3 (4+n) \tan (e+f x) (d \tan (e+f x))^{1+n}}{d f (2+n) (3+n)}+\frac {b^2 (d \tan (e+f x))^{1+n} (a+b \tan (e+f x))^2}{d f (3+n)}-\frac {\int (d \tan (e+f x))^n \left (-\left (a^4-6 a^2 b^2+b^4\right ) d^2 (2+n) (3+n)-4 a b \left (a^2-b^2\right ) d^2 (2+n) (3+n) \tan (e+f x)\right ) \, dx}{d^2 (2+n) (3+n)}\\ &=-\frac {b^2 \left (b^2 (3+n)-a^2 (17+5 n)\right ) (d \tan (e+f x))^{1+n}}{d f (1+n) (3+n)}+\frac {2 a b^3 (4+n) \tan (e+f x) (d \tan (e+f x))^{1+n}}{d f (2+n) (3+n)}+\frac {b^2 (d \tan (e+f x))^{1+n} (a+b \tan (e+f x))^2}{d f (3+n)}-\left (-a^4+6 a^2 b^2-b^4\right ) \int (d \tan (e+f x))^n \, dx+\frac {\left (4 a b \left (a^2-b^2\right )\right ) \int (d \tan (e+f x))^{1+n} \, dx}{d}\\ &=-\frac {b^2 \left (b^2 (3+n)-a^2 (17+5 n)\right ) (d \tan (e+f x))^{1+n}}{d f (1+n) (3+n)}+\frac {2 a b^3 (4+n) \tan (e+f x) (d \tan (e+f x))^{1+n}}{d f (2+n) (3+n)}+\frac {b^2 (d \tan (e+f x))^{1+n} (a+b \tan (e+f x))^2}{d f (3+n)}+\frac {\left (4 a b \left (a^2-b^2\right )\right ) \text {Subst}\left (\int \frac {x^{1+n}}{d^2+x^2} \, dx,x,d \tan (e+f x)\right )}{f}+\frac {\left (\left (a^4-6 a^2 b^2+b^4\right ) d\right ) \text {Subst}\left (\int \frac {x^n}{d^2+x^2} \, dx,x,d \tan (e+f x)\right )}{f}\\ &=-\frac {b^2 \left (b^2 (3+n)-a^2 (17+5 n)\right ) (d \tan (e+f x))^{1+n}}{d f (1+n) (3+n)}+\frac {\left (a^4-6 a^2 b^2+b^4\right ) \, _2F_1\left (1,\frac {1+n}{2};\frac {3+n}{2};-\tan ^2(e+f x)\right ) (d \tan (e+f x))^{1+n}}{d f (1+n)}+\frac {2 a b^3 (4+n) \tan (e+f x) (d \tan (e+f x))^{1+n}}{d f (2+n) (3+n)}+\frac {4 a b \left (a^2-b^2\right ) \, _2F_1\left (1,\frac {2+n}{2};\frac {4+n}{2};-\tan ^2(e+f x)\right ) (d \tan (e+f x))^{2+n}}{d^2 f (2+n)}+\frac {b^2 (d \tan (e+f x))^{1+n} (a+b \tan (e+f x))^2}{d f (3+n)}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 1.68, size = 191, normalized size = 0.73 \begin {gather*} \frac {\tan (e+f x) (d \tan (e+f x))^n \left (\frac {-b^4 (3+n)+a^2 b^2 (17+5 n)}{1+n}+\frac {\left (a^4-6 a^2 b^2+b^4\right ) (3+n) \, _2F_1\left (1,\frac {1+n}{2};\frac {3+n}{2};-\tan ^2(e+f x)\right )}{1+n}+\frac {2 a b^3 (4+n) \tan (e+f x)}{2+n}+\frac {4 a (a-b) b (a+b) (3+n) \, _2F_1\left (1,\frac {2+n}{2};\frac {4+n}{2};-\tan ^2(e+f x)\right ) \tan (e+f x)}{2+n}+b^2 (a+b \tan (e+f x))^2\right )}{f (3+n)} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [F]
time = 0.51, size = 0, normalized size = 0.00 \[\int \left (d \tan \left (f x +e \right )\right )^{n} \left (a +b \tan \left (f x +e \right )\right )^{4}\, dx\]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \left (d \tan {\left (e + f x \right )}\right )^{n} \left (a + b \tan {\left (e + f x \right )}\right )^{4}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.00 \begin {gather*} \int {\left (d\,\mathrm {tan}\left (e+f\,x\right )\right )}^n\,{\left (a+b\,\mathrm {tan}\left (e+f\,x\right )\right )}^4 \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________